package com.ssy.lingxi.pay.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 会员授信表
 * @author 伍将
 * @date 2020/8/13 15:42
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "pay_credit",
        indexes = {@Index(name = "pay_credit_member_id_idx", columnList = "memberId"),
                @Index(name = "pay_credit_role_id_idx", columnList = "memberRoleId"),
                @Index(name = "pay_credit_parent_member_id_idx", columnList = "parentMemberId"),
                @Index(name = "pay_credit_parent_role_id_idx", columnList = "parentMemberRoleId"),
                @Index(name = "pay_credit_status_idx", columnList = "status"),
                @Index(name = "pay_credit_repay_status_idx", columnList = "rePayStatus"),
                @Index(name = "pay_credit_is_usable_idx", columnList = "isUsable")})
public class CreditDO implements Serializable {
    private static final long serialVersionUID = 4263278171550370633L;

    /**
     * 授信id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "credit_seq")
    @SequenceGenerator(sequenceName = "pay_credit_seq", name = "credit_seq", allocationSize = 1)
    private Long id;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8")
    private Long memberId;

    /**
     * 会员角色id
     */
    @Column(columnDefinition = "int8")
    private Long memberRoleId;

    /**
     * 父级会员id
     */
    @Column(columnDefinition = "int8")
    private Long parentMemberId;

    /**
     * 父级会员角色id
     */
    @Column(columnDefinition = "int8")
    private Long parentMemberRoleId;

    /**
     * 现有额度
     */
    @Column(columnDefinition = "decimal")
    private Double quota;

    /**
     * 已用额度
     */
    @Column(columnDefinition = "decimal")
    private Double useQuota;

    /**
     * 账单日
     */
    @Column(columnDefinition = "int")
    private Integer billDay;

    /**
     * 还款周期
     */
    @Column(columnDefinition = "int")
    private Integer repayPeriod;

    /**
     * 授信状态 1-未申请 2-申请中 3-正常 4-已冻结
     */
    @Column(columnDefinition = "int")
    private Integer status;

    /**
     * 是否可用 0-否 1-是
     */
    @Column(columnDefinition = "int")
    private Integer isUsable;

    /**
     * 授信还款状态  1-账单待还 2-待确认还款结果 3-账单已还清 4-逾期
     * CreditRepayStatusEnum
     */
    @Column(columnDefinition = "int")
    private Integer rePayStatus;

    /**
     * 是否有过申请 0-否 1-是
     */
    @Column(columnDefinition = "int")
    private Integer isHasApply;

    /**
     * 到期日期(根据实际未还完最旧账单的到期日期动态改变)
     */
    @Column(columnDefinition = "int8")
    private Long expireTime;

    /**
     * 最后还款时间
     */
    @Column(columnDefinition = "int8")
    private Long lastRepayTime;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8")
    private Long createTime;

    /**
     * 更新时间
     */
    @Column(columnDefinition = "int8")
    private Long updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getMemberRoleId() {
        return memberRoleId;
    }

    public void setMemberRoleId(Long memberRoleId) {
        this.memberRoleId = memberRoleId;
    }

    public Long getParentMemberId() {
        return parentMemberId;
    }

    public void setParentMemberId(Long parentMemberId) {
        this.parentMemberId = parentMemberId;
    }

    public Long getParentMemberRoleId() {
        return parentMemberRoleId;
    }

    public void setParentMemberRoleId(Long parentMemberRoleId) {
        this.parentMemberRoleId = parentMemberRoleId;
    }

    public Double getQuota() {
        return quota;
    }

    public void setQuota(Double quota) {
        this.quota = quota;
    }

    public Double getUseQuota() {
        return useQuota;
    }

    public void setUseQuota(Double useQuota) {
        this.useQuota = useQuota;
    }

    public Integer getBillDay() {
        return billDay;
    }

    public void setBillDay(Integer billDay) {
        this.billDay = billDay;
    }

    public Integer getRepayPeriod() {
        return repayPeriod;
    }

    public void setRepayPeriod(Integer repayPeriod) {
        this.repayPeriod = repayPeriod;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsUsable() {
        return isUsable;
    }

    public void setIsUsable(Integer isUsable) {
        this.isUsable = isUsable;
    }

    public Integer getRePayStatus() {
        return rePayStatus;
    }

    public void setRePayStatus(Integer rePayStatus) {
        this.rePayStatus = rePayStatus;
    }

    public Integer getIsHasApply() {
        return isHasApply;
    }

    public void setIsHasApply(Integer isHasApply) {
        this.isHasApply = isHasApply;
    }

    public Long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }

    public Long getLastRepayTime() {
        return lastRepayTime;
    }

    public void setLastRepayTime(Long lastRepayTime) {
        this.lastRepayTime = lastRepayTime;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }
}
